/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package facade;

import entity.Orders;
import entity.Product;
import entity.Users;
import java.math.BigDecimal;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import javax.ejb.Local;

/**
 *
 * @author Svetlana Shikhutskaya
 * @author Ivchenko Oleg
 */
@Local
public interface OrdersFacadeLocal {

    void create(Orders orders);

    void edit(Orders orders);

    void remove(Orders orders);

    Orders find(Object id);

    List<Orders> findAll();

    List<Orders> findRange(int[] range);

    int count();

    int setDelivered(int idOrder);

    int setShipped(int idOrder);

    int cancelOrder(int idOrder);

    List<Orders> findRangeSortBy(int pageNum, String status, String orderBy, String sortType);

    int count(String status);

    public void create(Orders order, HashMap<Product, Integer> productList);

    public java.util.List<entity.Orders> findRangeByKey(int FirstResult, int Maxresults, entity.Users idUser, java.lang.Integer key);


    public List<Orders> findByStatus(String status);

    public List<Orders> findByPrice(BigDecimal minPrice, BigDecimal maxPrice);

    public List<Integer> getListQuantities();

    public List<BigDecimal> getListPrices();

    public List<String> getListStatuses();
    
    public entity.Orders findByTrackingNumber(int trNumber);

    public java.util.List<entity.Orders> findRangeSortBy(int pageNumber, entity.Users user, java.lang.String sortBy);

    public List<Integer> getListQuantitiesUniversal(Integer idUser, Integer idWarehouse);

    public List<BigDecimal> getListPricesUniversal(Integer idUser, Integer idWarehouse);

    public java.util.List<entity.Orders> findByStatusUniversal(java.lang.String status, java.lang.Integer idUser, java.lang.Integer idWarehouse);

    //public java.util.List<entity.Orders> findOrdersForReport(int pageNum, java.lang.String status, int idWarehouse, int idUser);

    public List<Orders> findOrdersByFilters(int pageNum, String status, int idWarehouse, int idUser);

    public List<Orders> findOrdersForReport(int page, String status, int warehouse, int user, Date startDate, Date endDate);

//    public List<Orders> findByAllFilters(String status, int idUser, int idWarehouse, Date startDate, Date endDate);

    public List<Orders> findByStatusUniversalPlusDate(String status, Integer idUser, Integer idWarehouse, Date startDate, Date endDate);

    public long countOrders(Users idUser);

    public int getPagesQuantity(java.lang.String status, int warehouse, int user, java.util.Date startDate, java.util.Date endDate, int ordersPerPage);
}
